package com.ruoyi.weixin.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.weixin.mapper.GradeMapper;
import com.ruoyi.weixin.domain.Grade;
import com.ruoyi.weixin.service.IGradeService;
import com.ruoyi.common.core.text.Convert;

/**
 * 等级Service业务层处理
 * 
 * @author cloudoer
 * @date 2019-09-24
 */
@Service
public class GradeServiceImpl implements IGradeService 
{
    @Autowired
    private GradeMapper gradeMapper;

    /**
     * 查询等级
     * 
     * @param gradeId 等级ID
     * @return 等级
     */
    @Override
    public Grade selectGradeById(Long gradeId)
    {
        return gradeMapper.selectGradeById(gradeId);
    }

    /**
     * 查询等级列表
     * 
     * @param grade 等级
     * @return 等级
     */
    @Override
    public List<Grade> selectGradeList(Grade grade)
    {
        return gradeMapper.selectGradeList(grade);
    }

    /**
     * 新增等级
     * 
     * @param grade 等级
     * @return 结果
     */
    @Override
    public int insertGrade(Grade grade)
    {
        return gradeMapper.insertGrade(grade);
    }

    /**
     * 修改等级
     * 
     * @param grade 等级
     * @return 结果
     */
    @Override
    public int updateGrade(Grade grade)
    {
        return gradeMapper.updateGrade(grade);
    }

    /**
     * 删除等级对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteGradeByIds(String ids)
    {
        return gradeMapper.deleteGradeByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除等级信息
     * 
     * @param gradeId 等级ID
     * @return 结果
     */
    public int deleteGradeById(Long gradeId)
    {
        return gradeMapper.deleteGradeById(gradeId);
    }
}
